package javaSE.LibrarySystem.Book;

//***************图书列表***********************
public class BookList {
    Book[] bookList = new Book[20];
    private int usedSize;

    public BookList() {
        this.bookList[0] = new Book("三国演义", "罗贯中", "小说", 58);
        this.bookList[1] = new Book("红楼梦", "曹雪芹", "小说", 45);
        this.bookList[2] = new Book("西游记", "吴承恩", "小说", 38);
        this.bookList[3] = new Book("水浒传", "施耐庵", "小说", 43);
        this.usedSize = 4;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    //拿到指定位置pos的书籍
    public Book getBook(int pos) {
        return bookList[pos];
    }

    //将书籍放在指定位置pos上
    public void setBook(int pos, Book book) {
        bookList[pos] = book;
    }
}
